﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using IssueIT.Core.Infrastructure.Logging;
using IssueIT.WebUI.Models;

namespace IssueIT.WebUI.Controllers
{
    public class HomeController : IssueBaseController
    {
        public HomeController(ILogger logger) : base(logger)
        {
        }

        public ActionResult Index()
        {

            //test data
            var model = new DashboardViewModel();
            
            model.Add(new ProjectOverviewModel{Title = "Målerjagten", UriName = "maalerjagten", OpenIssues = new IssuesOverviewModel{ All = 5, CurrentUser = 3}});
            model.Add(new ProjectOverviewModel { Title = "Another project", UriName = "anotherproject", OpenIssues = new IssuesOverviewModel { All = 18, Unassigned = 10, Uncovred = 3 } });
            model.Add(new ProjectOverviewModel { Title = "Yet another project", UriName = "yetanotherproject", OpenIssues = new IssuesOverviewModel { All = 33, CurrentUser = 8, Unassigned = 15} });

            ViewBag.Heading = "issueIT.net";
            ViewBag.Title = "Dashboard";
            return View(model);
        }

    }
}
